using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;
using Microsoft.VisualStudio.DebuggerVisualizers;
using Microsoft.Xna.Framework;
[assembly: DebuggerVisualizer(typeof(Xfinity.Debugging.Visualizers.Vector3Visualizer),
                             typeof(VisualizerObjectSource),
                             Target = typeof(Microsoft.Xna.Framework.Vector3))]
namespace Xfinity.Debugging.Visualizers
{
    // TODO: Add the following to SomeType's definition to see this visualizer when debugging instances of SomeType:
    // 
    //  [DebuggerVisualizer(typeof(Vector3Visualizer))]
    //  [Serializable]
    //  public class SomeType
    //  {
    //   ...
    //  }
    // 
    /// <summary>
    /// A Visualizer for SomeType.  
    /// </summary>
    public class Vector3Visualizer : DialogDebuggerVisualizer
    {
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            // TODO: Get the object to display a visualizer for.
            //       Cast the result of objectProvider.GetObject() 
            //       to the type of the object being visualized.
            Vector3 data = (Vector3)objectProvider.GetObject();

            // TODO: Display your view of the object.
            //       Replace displayForm with your own custom Form or Control.
            using (TestGameRig rig = new TestGameRig(null, drawVector,null,null))
            {
                throw new NotImplementedException();
                rig.Init();
                //windowService.ShowDialog(Form.FromHandle(rig.Window.Handle));

                rig.Tick();
                //windowService.ShowDialog(displayForm);
            }
        }
        private void drawVector(GameTime g)
        {
            MessageBox.Show("Test");
        }

        // TODO: Add the following to your testing code to test the visualizer:
        // 
        //    Vector3Visualizer.TestShowVisualizer(new SomeType());
        // 
        /// <summary>
        /// Tests the visualizer by hosting it outside of the debugger.
        /// </summary>
        /// <param name="objectToVisualize">The object to display in the visualizer.</param>
        public static void TestShowVisualizer(object objectToVisualize)
        {
            VisualizerDevelopmentHost visualizerHost = new VisualizerDevelopmentHost(objectToVisualize, typeof(Vector3Visualizer));
            visualizerHost.ShowVisualizer();
        }
    }
}